#!/bin/bash
echo "--- Run pre setup script in advance of puppet provision" 

# Install mod_ssl for https
yum -y install mod_ssl

# Pre puppet: copy ssl certs from host to guest vm for its puppet client,
# which is already signed by puppet master for the puppet node name specified in Vagrantfile
mkdir -p /var/lib/puppet/ssl; cp -r /vagrant/vagtools/puppet.ssl/* /var/lib/puppet/ssl/

# untar the plugins before hand so that we don't have to sync that from puppet server 
mkdir -p /var/lib/puppet; tar -xzvf /vagrant/vagtools/puppet-master-plugins.tar.gz -C /var/lib/puppet

# make those dirs for jenkins test purpose. Will be created by developers in reality.
#mkdir -p /opt/bcs/www/assets
#mkdir -p /opt/bcs/www/protected/runtime
 
mkdir -p /etc/smx; cp config-override.data.txt /etc/smx/

echo "-- pre steps DONE --"
echo "-- Puppet provision begins here --"
